﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="StudentGrid.aspx.cs" Inherits="StudentGrid" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>学生列表</title>
    <link href="../Common/css/main.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        #load{width:500px;height:25px;border:1px #000 solid;}
        #loading{position:absolute;z-index:2;height:23;filter:progid:DXImageTransform.microsoft.gradient(gradienttype=1,startColorStr=white,endColorStr=#39867b);}
        #loadtext{position:absolute;z-index:3;width:100%;height:100%;line-height:23px;text-align:center;}
    </style>

    <script type="text/javascript" src="../Common/Js/jquery.js"></script>

    <script type="text/javascript" src="../Common/Js/common.js"></script>

    <script type="text/javascript" src="../Common/Js/msg.js"></script>

    <script type="text/javascript" src="../Common/Js/jsUtil.js"></script>

    <script type="text/javascript" src="../Common/Js/My97DatePicker/WdatePicker.js"></script>

    <script type="text/javascript">
    
    var optionType = '';
    var editStudentID = 0;
    var checkedArr;
    var iClassID = 0;

    function Load()
    {
        var arr = new Array();
        var u = window.location.toString();
        u = u.split('?');
        if (typeof(u[1]) == 'string') {
            u=u[1].split('&');
            for(i=0;i<u.length;i++)
            {
                s=u[i].split("=");
                eval('arr["' + s[0] + '"]' + '="' + s[1]+'"');
            }
        }
        iClassID= arr['id'];
        
        if (iClassID != null)
        {           
            Bind(); 
        }
    }
    
    function Bind()
    {
        document.getElementById('HFClassIDValue').value = iClassID;
        document.getElementById('btnBind').click();    
    }
    
    //添加窗口
    function ShowAddWindow()
    {
        if (self.parent.currClass <= 0)
        {
            showMassgeBox("提示","请先选择班级，再进行添加", 1, null);
            return;            
        }
        
        
        optionType = 'add';
     
        //显示添加教师信息对话框
        ShowPopForm("popTable", "formTitle", "添加学生信息");
        //显示背景遮罩
        ShowMask();
        
        self.parent.frames['left'].activate = 0;
    }
    
    //更新窗口
    function ShowUpdateWindow(obj)
    {
        optionType = 'update';
        ShowPopForm("popTable", "formTitle", "修改学生信息");

        ShowMask();
        self.parent.frames['left'].activate = 0;
        var studentId = obj.id;
        editStudentID = studentId;

        PageMethods.GetStudentInfoById(editStudentID, function(succ){       
            if(succ.length <=0)
                return;
    
            //绑定学生信息
            document.getElementById('popStudentCode').value = succ.StudentCode;
            document.getElementById('popStudentCode').setAttribute("oldCode",succ.StudentCode);
            document.getElementById('popStudentName').value = succ.StudentName;
            document.getElementById('popStudentSexy').selectedIndex = succ.Sexy;
            
            if (succ.Birthday.getFullYear() != "9999")
            {
                document.getElementById('txtBrithYear').value = succ.Birthday.getFullYear();
                document.getElementById('txtBrithMonth').value = succ.Birthday.getMonth() + 1;
                document.getElementById('txtBrithDay').value = succ.Birthday.getDate();
            }
            else
            {
                document.getElementById('txtBrithYear').value = "";
                document.getElementById('txtBrithMonth').value = "";
                document.getElementById('txtBrithDay').value = "";
            } 
            
            if (succ.InSchoolDate.getFullYear() != "9999") 
            {
                document.getElementById('txtInSchoolYear').value = succ.InSchoolDate.getFullYear();
                document.getElementById('txtInSchoolMonth').value = succ.InSchoolDate.getMonth() + 1;
                document.getElementById('txtInSchoolDay').value = succ.InSchoolDate.getDate();
            }
            else
            {
                document.getElementById('txtInSchoolYear').value = "";
                document.getElementById('txtInSchoolMonth').value = "";
                document.getElementById('txtInSchoolDay').value = "";
            }    
            
            //var dateStr;
            //dateStr = succ.Birthday.getFullYear() + "-" + (succ.Birthday.getMonth() + 1) + "-" + succ.Birthday.getDate();
            //document.getElementById('popStudentBirthday').value = dateStr;
            //dateStr = succ.InSchoolDate.getFullYear() + "-" + (succ.InSchoolDate.getMonth() + 1) + "-" + succ.InSchoolDate.getDate();
            //document.getElementById('popStudentInSchoolTime').value = dateStr;

        },function(err){//异步失败
            showMassgeBox("提示", STUDENT_FAIL, 1, null);
        }) 
    }
    
    function Add(studentCode, studentName, studentSexy, studentBirthday, studentInSchoolTime)
    {
        var studentInfo = {RID:0, StudentCode:studentCode, StudentName:studentName, Sexy:studentSexy,  
                           Birthday:studentBirthday, InSchoolDate:studentInSchoolTime, ClsID:self.parent.currClass};
                           
        PageMethods.ValidateUsed(0, studentCode, function(succ){ 
               if(succ > 0)
               {
                    if (succ == 1)
                    {
                        showNoticMsg('popStudentCode', "该学号已存在，请重新输入"); 
                        document.getElementById('popStudentCode').select();   
                        return;              
                    }
                    
                    if (succ == 2)
                    {
                        showNoticMsg('popStudentCode', "该学号已作废，请重新输入"); 
                        document.getElementById('popStudentCode').select();   
                        return;
                    }

               }
               else
               {  
                    PageMethods.InsertStudentInfo(studentInfo, function(succ)
                    {
                        if (succ > 0)
                        {
                            Load();
                            CloseMask('popTable');
                        }
                        else
                        {
                            showMassgeBox("提示",STUDENT_INSERT_FAIL, 1, null);
                        } 	
                    },function(err){
                        showMassgeBox("提示", STUDENT_INSERT_FAIL, 1, null);
                    })
               }
            },function(err){
                 showMassgeBox("提示",STUDENT_FAIL, 1, null);
            });
    }

    function Update(studentCode, studentName, studentSexy, studentBirthday, studentInSchoolTime)
    {   
        var studentInfo = {RID:editStudentID, StudentCode:studentCode, StudentName:studentName, Passwd:studentCode, Sexy:studentSexy,  
                   Birthday:studentBirthday, InSchoolDate:studentInSchoolTime, ClsID:self.parent.currClass};
        
        var oldStudentCode = document.getElementById('popStudentCode').getAttribute('oldCode');
        
        //当学生学号发生改变时，需要进行验证
        if (oldStudentCode != studentCode)
        {
            PageMethods.ValidateUsed(editStudentID, studentCode,function(succ){ 
               if(succ > 0)
               {
                    if (succ == 1)
                    {
                        showNoticMsg('popStudentCode', "该学号已存在，请重新输入"); 
                        document.getElementById('popStudentCode').select();   
                        return;              
                    }
                    
                    if (succ == 2)
                    {
                        showNoticMsg('popStudentCode', "该学号已作废，请重新输入"); 
                        document.getElementById('popStudentCode').select();   
                        return;
                    }
               }
               else
               {  
                    PageMethods.UpdateStudentInfo(studentInfo, function(succ)
                    {
                        if (succ > 0)
                        {
                            Load();
                            CloseMask('popTable');
                        }
                        else
                        {
                            showMassgeBox("提示", STUDENT_UPDATE_FAIL,1,null);
                        } 	
                    },function(err){
                        showMassgeBox("提示",STUDENT_UPDATE_FAIL,1,null);
                    })
               }
            },function(err){
                 showMassgeBox("提示",STUDENT_FAIL,1,null);
            });
        }
        //没有修改的情况直接更新
        else
        {
            PageMethods.UpdateStudentInfo(studentInfo, function(succ)
            {
                if (succ > 0)
                {
                    Load();
                    CloseMask('popTable');
                }
                else
                {
                    showMassgeBox("提示", STUDENT_UPDATE_FAIL,1,null);
                } 	
             },function(err){
                  showMassgeBox("提示",STUDENT_FAIL,1,null);
           });
        }        
    }

    //保存学生信息
    function Save()
    {
        var studentCode = document.getElementById('popStudentCode').value.Trim();
        var studentName = document.getElementById('popStudentName').value.Trim();
        var studentSexy = document.getElementById('popStudentSexy').options[document.getElementById('popStudentSexy').selectedIndex].value;
        var studentBirthday = "";
        var studentInSchoolTime = "";
         
        if ( (document.getElementById('txtBrithYear').value != "")  || 
             (document.getElementById('txtBrithMonth').value != "") || 
             (document.getElementById('txtBrithDay').value != "") )
        {
            studentBirthday = document.getElementById('txtBrithYear').value + 
                         '-'+ document.getElementById('txtBrithMonth').value + 
                         '-'+ document.getElementById('txtBrithDay').value;
        }
        
        if ( (document.getElementById('txtInSchoolYear').value != "")  || 
             (document.getElementById('txtInSchoolMonth').value != "") || 
             (document.getElementById('txtInSchoolDay').value != "") )
        {
            studentInSchoolTime = document.getElementById('txtInSchoolYear').value + 
                         '-'+ document.getElementById('txtInSchoolMonth').value + 
                         '-'+ document.getElementById('txtInSchoolDay').value;
        }

        //var studentBirthday = document.getElementById('popStudentBirthday').value.Trim();
        //var studentInSchoolTime = document.getElementById('popStudentInSchoolTime').value.Trim();
        
        if (studentCode == "")
        {
            showNoticMsg('popStudentCode',STUDENT_CODE_NULL);
            document.getElementById('popStudentCode').select();  
            return;  
        }
        if (studentName == "")
        {
            showNoticMsg('popStudentName',STUDENT_NAME_NULL);
            document.getElementById('popStudentName').select();  
            return;  
        }
        if (getStringCount(studentCode) >20)
        {
            showNoticMsg('popStudentCode',STUDENT_NAME_LENTH);
            document.getElementById('popStudentCode').select();              
            return;
        }
        if (containSpecialChar(studentCode) == true)
        {
            showNoticMsg('popStudentCode',STUDENT_CODE_WRONG);
            document.getElementById('popStudentCode').select();              
            return;
        }
        if (containSpecialChar(studentName) == true)
        {
            showNoticMsg('popStudentName',STUDENT_NAME_WRONG);
            document.getElementById('popStudentName').select();              
            return;
        }
        
        if ( (studentBirthday != "") && (!validDate(studentBirthday)) )
        {
            showNoticMsg('txtBrithYear',"日期格式不正确，请重新输入");
            document.getElementById('txtBrithYear').select(); 
            return;
        }
        
        if ( (studentInSchoolTime != "") && (!validDate(studentInSchoolTime)) )
        {
            showNoticMsg('txtInSchoolYear',"日期格式不正确，请重新输入");
            document.getElementById('txtInSchoolYear').select(); 
            return;
        }
          
        if (optionType == "add")
        {
            Add(studentCode, studentName, studentSexy, studentBirthday, studentInSchoolTime);
        }
        if (optionType == "update")
        {
            Update(studentCode, studentName, studentSexy, studentBirthday, studentInSchoolTime);
        }
    }

//    //删除学生信息
//    function delStudentInfo(obj)
//    {
//        PageMethods.DeleteStudentInfo(obj, function(succ)
//        {
//             if (succ>0)
//             {                    
//                Load();       
//                showMassgeBox("提示",STUDENT_DELETE_SUCC,1,null);      
//             } 
//             else
//             {
//                showMassgeBox("提示",STUDENT_DELETE_FAIL,1,null);
//             }      
//        },function(err){
//            showMassgeBox("提示",STUDENT_FAIL,1,null);
//        })

//    }

    //批量删除教师信息
    function DeleteList()
    {
        var arr = ValidateChecked();
        if(arr.length > 0)
        {
            showConfirmBox("删除", STUDENT_DELETE_SURE, delStudentInfo, arr);
        }
        else
            showMassgeBox("提示",STUDENT_NO_SELECT);
    }

    function ShowMoveWindow()
    {
        var arr = ValidateChecked();
        if(arr.length > 0)
        {
                    ShowPopForm("Div_move", "Span_move", "学籍变动");
                    ShowMask();
                    self.parent.frames['left'].activate = 0;
        }
        else
            showMassgeBox("提示",STUDENT_NO_SELECT);
    }
    
    function movestudent()
    {
        var arr = ValidateChecked();
        //showConfirmBox("处理", "确定执行该处理？", delStudentInfo, arr);
        delStudentInfo(arr);
        CloseMask('Div_move');
    }
    
    //删除学生信息
    function delStudentInfo(obj)
    {
        var obj_zx = document.getElementById("status_zx");
        var status_xx = document.getElementById("status_xx");
        var status_zaix = document.getElementById("status_zaix");

        var status = 1;

        if(obj_zx.checked)
            status = -2;
        if(status_xx.checked)
            status = -1;
        if(status_zaix.checked)
            status = 1;
        PageMethods.DeleteStudentInfo(obj,status , function(succ)
        {
             if (succ>0)
             {                    
                Load();       
                showMassgeBox("提示","该操作执行成功！",1,null);      
             } 
             else
             {
                showMassgeBox("提示","该操作执行成功！",1,null);
             }      
        },function(err){
            showMassgeBox("提示",STUDENT_FAIL,1,null);
        })

    }
    
    //检验CheckBox是否已经打钩
    function ValidateChecked()
    {
        var arr = new Array();
        if(document.getElementById("StudentTable") != null)
        {
            var checkItems=document.getElementById("StudentTable").getElementsByTagName('input');
　　        for(var i=1;i < checkItems.length;i++){
　　　　        var checkItem= checkItems[i];
　　　　        if(checkItem.type==='checkbox' && checkItem.checked)
　　　　        {
　　　　            arr.push(checkItem.userid);
　　　　        }
　　        }
　　    }
        return arr;
    }

    //全选 Checkbox
    function CheckedAll(obj)
    {
        var checkItems=document.getElementById("StudentTable").getElementsByTagName('input');
        for(var i=0;i < checkItems.length;i++){
　　　　    var checkItem= checkItems[i];
　　　　    if(checkItem.type==='checkbox'){
　　　　　    checkItem.checked = obj.checked ;
　　　　    }
　　    }
    }

    //显示遮罩层
    function ShowMask()
    {
        showMask();
        self.parent.frames['left'].showMask();
    }

    //弹出对话框的关闭按钮
    function CloseMask(formId)
    {
        self.parent.frames['left'].activate = 1;
        
        ReleasePopTable();
        ClosePopForm(formId,true);
        hideMask();
        self.parent.frames['left'].hideMask();
    }

    //添加或更新操作成功后清空内容
    function ReleasePopTable()
    {
        document.getElementById('popStudentCode').value = "";
        document.getElementById('popStudentName').value = ""
        //document.getElementById('popStudentBirthday').value = "";
        document.getElementById('txtBrithYear').value = "";
        document.getElementById('txtBrithMonth').value = "";
        document.getElementById('txtBrithDay').value = "";
        document.getElementById('txtInSchoolYear').value = "";
        document.getElementById('txtInSchoolMonth').value = "";
        document.getElementById('txtInSchoolDay').value = "";
        document.getElementById('popStudentSexy').selectedIndex=0;
        
        //document.getElementById('popStudentInSchoolTime').value = "";
        //document.getElementById('popStudentSexy').selectedIndex=0;
    }
    
    //设置行点击高亮
    function SetHightLight(obj)
    {
        obj.style.backgroundColor = "#fffccf";
        var table = document.getElementById('StudentTable');
        for(var i =0 ; i < table.rows.length;i++)
        {
        var row = table.rows[i];
        if(row != null && row.id != obj.id)
            row.style.backgroundColor = "#ffffff";

        }
    }
    
    //重置学生密码
    function ResetPassword()
    {
        var arr = ValidateChecked();
        if(arr.length > 0)
            showConfirmBox("重置密码", STUDENT_RESET_SURE, resetPassword, arr);
        else
            showMassgeBox("提示",STUDENT_NO_SELECT,1,null);
    }
    function resetPassword(arr)
    {
        PageMethods.ResetPassword(arr,function(succ){
            showMassgeBox("提示",STUDENT_RESET_PWD_SUCC,1,null);
            Bind();
        },function(err){
           showMassgeBox("提示",STUDENT_RESET_PWD_FAIL,1,null);
        });
    }
    
    //显示转班窗口学生转班
    function ShowShiftClass()
    {
        //获取选择学生ID列表-----------------------------------------------------------------------------
        checkedArr = ValidateChecked();
        if(checkedArr.length <= 0)
        {
            showMassgeBox("提示",STUDENT_NO_SELECT,1,null);
            return;
        }
             
        //显示转班弹出    
        ShowPopForm("popTable1", "formTitle1", "转班");
        ShowMask();
        self.parent.frames['left'].activate = 0;
                
        //初始化选择学生列表-----------------------------------------------------------------------------
        PageMethods.InitShiftClassList(checkedArr, function(succ){
            if (succ.length > 0)
            {
                //表格有2列,获取表格行数
                var maxCol = 3;
                var maxRow = Math.ceil( succ.length/maxCol );
                
                var strTable = [""];
                strTable.push("<table border=\"1\" cellpadding=\"0\" cellspacing=\"1\" class=\"useList\" bordercolor=\"#c3dce5\" width=\"96%\" height=\"" + maxRow*20 + "\">");
                
                for(var i = 0; i < maxRow; i++)
                {
                    strTable.push("<tr class=\"tableTitle\">");
                    for(var j = 0; j < maxCol; j++)
                    {
                        var studentName = "";
                        var index = i*maxCol+j;
			            if (index < succ.length)
			                studentName = succ[index].StudentName;
			                
                        strTable.push("<td width=\"" + Math.ceil( 100/maxCol ) + "%\" style=\"text-align: left;padding-left:5px;\">" + studentName +"</td>");
                    }
                    strTable.push("</tr>");  
                }
                
                strTable.push("</table>"); 
                
                var obj = document.getElementById("tableDiv");
                obj.innerHTML = strTable.join("");
            }
        },function(err){//异步失败
            showMassgeBox("提示",STUDENT_FAIL,1,null); 
        });
        
        //初始化班级下拉框-----------------------------------------------------------------------------
        document.getElementById("popSelectClass").value = self.parent.currClass;        
        
        //var objclslst = document.getElementById("popSelectClass");
        ////清空
        //while(objclslst.options.length)
        //{
        //    objclslst.options.remove(0);
        //}
        //
        //PageMethods.GetClsInfoList(function(succ){
        //    if ( (succ != null) && (succ.length > 0) )
        //    {
        //        for(var i = 0; i < succ.length;i++)
        //        {
        //            var oOption = document.createElement("OPTION");
        //            oOption.text=succ[i].ClsName;
        //            oOption.value=succ[i].RID;
        //            objclslst.add(oOption);
        //        }
        //        objclslst.value = self.parent.currClass;
        //    }
        //},function(err){//异步失败
        //    showMassgeBox("提示",STUDENT_FAIL,1,null); 
        //});
    }
    
    //确认转班
    function ShiftClassOK()
    {
        var objclslst = document.getElementById("popSelectClass");
        //没有修改班级
        if (objclslst.value == self.parent.currClass)   
        {
            CloseMask('popTable1');
            return;
        }
        
        PageMethods.StudentShiftClass(checkedArr, objclslst.value, function(succ){
            if (succ > 0)
            {
                Load();
                CloseMask('popTable1');
            }
        },function(err){//异步失败
            showMassgeBox("提示",STUDENT_FAIL,1,null); 
        });
    }
    
    //导入文件
    function ImportHandle()
    {
        if (self.parent.currClass <= 0)
        {
            showMassgeBox("提示","请先选择班级，再进行添加", 1, null);
            return;            
        }
        
        document.getElementById("chkOverWrite").checked = false;
        ShowPopForm("ImportForm", "ImportFormTitle", "Excel导入");                         
        document.getElementById("upload").innerHTML='<input id="File1"  name="File1" type="file" style="width:300px" />';
    }
    
    function CloseForm()
    {
       document.getElementById("txtClassid").value = 0;
       ClosePopForm("ImportForm");
       
    }
    
    function GetActionString()
    {
        var type = 0;
        if (document.getElementById("chkOverWrite").checked)
            type = 1;
        document.getElementById("form2").action = "ImportStudent.aspx?clsid=" + self.parent.currClass + "&optype=" + type;
    }
    
    function DownLoadExcel()
    {
        document.getElementById("downloadFrame").src = "templatedownload.aspx?templatetype=student";
    }
    
    function ShowUpdateLoad()
    {
        document.getElementById('uploadf').src = "";
        document.getElementById('uploadf').src = "StudentGridUpload.aspx?clsid="+self.parent.currClass;
        ShowPopForm("upInputPop", "upInputPopTitle","学生信息更新导入")   ; 
    }
    
   function HaveDone(status,msg)
    {
        ClosePopForm('upInputPop');
        if(status==1)
        {
            document.getElementById("btnBind").click();
        }
        else
        {
            document.getElementById('msginfo').innerHTML = msg;
            ShowPopForm("upInputPop1", "upInputPopTitle1","提示信息")   ; 
            document.getElementById("btnBind").click();
            //showMassgeBox("提示",msg,1,null);
        }
    }
    </script>

</head>
<body onload="Load();">
    <div class="mainWarp">
        <div class="pageBody">
            <form id="form1" runat="server">
                <div>
                    <ul class="butList">
                        <li>
                            <input type="button" id="btnInsert" value="新增" class="commonBut" onclick="ShowAddWindow();" /></li>
                        <li>
                            <input type="button" id="btnDel" value="学籍变动" class="commonBut" onclick="ShowMoveWindow();" /></li>
                        <li>
                            <input type="button" id="btnChangeClass" value="转班" class="commonBut" onclick="ShowShiftClass();" /></li>
                        <li>
                            <input type="button" id="btnResetpwd" value="重置密码" class="commonBut" onclick="ResetPassword();" /></li>
                        <li>
                            <input type="button" id="btnImport" value="增量导入" class="commonBut" onclick="ImportHandle();" /></li>
                        <li>
                            <input type="button" id="Button2" value="更新导入" class="commonBut" onclick="ShowUpdateLoad()" /></li>
                    </ul>
                </div>
                <div>
                    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
                    </asp:ScriptManager>
                </div>
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                        <asp:Repeater ID="Repeater1" runat="server">
                            <HeaderTemplate>
                                <table id="StudentTable" border="0" cellpadding="0" cellspacing="1" class="useList">
                                    <tr class="tableTitle">
                                        <th width="10%" height="26">
                                            <input type="checkbox" onclick="CheckedAll(this);" /></th>
                                        <th width="15%" style="text-align: left; padding-left: 5px;">
                                            学号</th>
                                        <th width="15%" style="text-align: left; padding-left: 5px;">
                                            姓名</th>
                                        <th width="10%" style="text-align: left; padding-left: 5px;">
                                            性别</th>
                                        <th width="15%" style="text-align: left; padding-left: 5px;">
                                            出生日期</th>
                                        <th width="15%" style="text-align: left; padding-left: 5px;">
                                            入团日期</th>
                                        <th width="10%" style="text-align: left; padding-left: 5px;">
                                            状态</th>
                                        <th width="10%">
                                        </th>
                                    </tr>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <tr id="<%#DataBinder.Eval(Container.DataItem,"RID")%>" onclick="SetHightLight(this);"
                                    style="background-color: White;">
                                    <td height="26">
                                        <input type="checkbox" userid="<%# DataBinder.Eval(Container.DataItem, "RID") %>" /></td>
                                    <td name="StudentCode" style="text-align: left; font-weight: normal; padding-left: 5px;">
                                        <%# DataBinder.Eval(Container.DataItem, "StudentCode")%>
                                    </td>
                                    <td name="StudentName" style="text-align: left; font-weight: normal; padding-left: 5px;">
                                        <%# DataBinder.Eval(Container.DataItem, "StudentName")%>
                                    </td>
                                    <td name="Sexy" style="text-align: left; font-weight: normal; padding-left: 5px;">
                                        <%# DataBinder.Eval(Container.DataItem, "SexyStr")%>
                                    </td>
                                    <td name="Birthday" style="text-align: left; font-weight: normal; padding-left: 5px;">
                                        <%# DataBinder.Eval(Container.DataItem, "BirthdayStr")%>
                                    </td>
                                    <td name="InSchoolDate" style="text-align: left; font-weight: normal; padding-left: 5px;">
                                        <%# DataBinder.Eval(Container.DataItem, "InSchoolDateStr")%>
                                    </td>
                                    <td name="InStatus" style="text-align: left; font-weight: normal; padding-left: 5px;">
                                        <%# GetStatusStr(Convert.ToInt32(DataBinder.Eval(Container.DataItem, "intIsEffect")))%>
                                    </td>
                                    <td>
                                        <img src="../common/images/hadle_icon.gif" alt="修改学生信息" class="imageBtnStyle" onclick="ShowUpdateWindow(this.parentElement.parentElement);" />
                                    </td>
                                </tr>
                            </ItemTemplate>
                            <FooterTemplate>
                                </table>
                            </FooterTemplate>
                        </asp:Repeater>
                        <webdiyer:AspNetPager ID="AspNetPager1" runat="server" HorizontalAlign="Right" PageSize="15"
                            Width="100%" PagingButtonSpacing="10px" OnPageChanged="AspNetPager1_PageChanged"
                            ButtonImageAlign="left">
                        </webdiyer:AspNetPager>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="btnBind" EventName="Click" />
                    </Triggers>
                </asp:UpdatePanel>
                <div style="display: none;">
                    <asp:Button ID="btnBind" runat="server" OnClick="btnBind_Click" Text="btnBind" />
                    <asp:TextBox ID="txtClassId" Text="" runat="server"></asp:TextBox>
                    <asp:HiddenField ID="HFClassIDValue" runat="server" Value=""></asp:HiddenField>
                    <iframe src="" name="ifram" id="downloadFrame" style="height: 80%; width: 95%; overflow-y: auto;
                        overflow-x: none;" frameborder="0"></iframe>
                </div>
            </form>
            <!-- 新增/修改学区弹出界面 开始-->
            <div id="popTable" class="layoutWarp" style="display: none; width: 400px; overflow: inherit;">
                <div class="title">
                    <span id="formTitle">新增</span> <a title="关闭" onclick="return CloseMask('popTable')">
                        关闭</a>
                </div>
                <table style="width: 380px; margin-top: 12px;" border="0" class="layoutTable">
                    <tr>
                        <td align="right" style="width: 154px">
                            学号:</td>
                        <td style="text-align: left; color: Red">
                            <input type="text" style="width: 120px" id="popStudentCode" class="txtStyle" maxlength="20" />
                            *</td>
                    </tr>
                    <tr>
                        <td align="right" style="width: 154px">
                            姓名:</td>
                        <td style="text-align: left; color: Red">
                            <input type="text" style="width: 120px" id="popStudentName" class="txtStyle" maxlength="10" />
                            *</td>
                    </tr>
                    <tr>
                        <td align="right" style="width: 154px">
                            性别:</td>
                        <td align="left">
                            <select id="popStudentSexy" style="width: 44px">
                                <option value="0" selected="selected">男</option>
                                <option value="1">女</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td align="right" style="width: 154px">
                            出生日期:</td>
                        <td style="text-align: left">
                            <input type="text" id="txtBrithYear" style="width: 40px; text-align: center; border-left: 0px;
                                border-top: 0px; border-right: 0px;" maxlength="4" onkeypress="event.returnValue=((event.keyCode>=48)&&(event.keyCode<=57));" />
                            -
                            <input type="text" id="txtBrithMonth" style="width: 20px; text-align: center; border-left: 0px;
                                border-top: 0px; border-right: 0px;" maxlength="2" onkeypress="event.returnValue=((event.keyCode>=48)&&(event.keyCode<=57));" />
                            -
                            <input type="text" id="txtBrithDay" style="width: 20px; text-align: center; border-left: 0px;
                                border-top: 0px; border-right: 0px;" maxlength="2" onkeypress="event.returnValue=((event.keyCode>=48)&&(event.keyCode<=57));" />
                        </td>
                    </tr>
                    <tr>
                        <td align="right" style="width: 154px">
                            入团日期:</td>
                        <td style="text-align: left">
                            <input type="text" id="txtInSchoolYear" style="width: 40px; text-align: center; border-left: 0px;
                                border-top: 0px; border-right: 0px;" maxlength="4" onkeypress="event.returnValue=((event.keyCode>=48)&&(event.keyCode<=57));" />
                            -
                            <input type="text" id="txtInSchoolMonth" style="width: 20px; text-align: center;
                                border-left: 0px; border-top: 0px; border-right: 0px;" maxlength="2" onkeypress="event.returnValue=((event.keyCode>=48)&&(event.keyCode<=57));" />
                            -
                            <input type="text" id="txtInSchoolDay" style="width: 20px; text-align: center; border-left: 0px;
                                border-top: 0px; border-right: 0px;" maxlength="2" onkeypress="event.returnValue=((event.keyCode>=48)&&(event.keyCode<=57));" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3" align="center">
                            <ul class="butList">
                                <input type="button" id="btnsave" value="保存" onclick="Save()" class="commonBut" />
                                <input type="button" value="取消" onclick=" CloseMask('popTable');" class="commonBut" />
                            </ul>
                        </td>
                    </tr>
                </table>
            </div>
            <!-- 新增/修改学区弹出界面 结束 -->
            <!-- 转班弹出界面 开始-->
            <div id="popTable1" class="layoutWarp" style="display: none; width: 400px; overflow: inherit;">
                <div class="title">
                    <span id="formTitle1">新增</span> <a title="关闭" onclick="return CloseMask('popTable1')">
                        关闭</a>
                </div>
                <table style="width: 380px; margin-top: 12px; margin-bottom: 15px;" border="0">
                    <tr>
                        <td colspan="3" valign="top">
                            <div id="tableDiv" style="height: 150px; display: block; overflow: auto;">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            转入班级:
                            <select id="popSelectClass" style="width: 120px">
                                <%= Common.GetClassOption()%>
                            </select>
                            <input type="button" id="Button1" value="确定" onclick="ShiftClassOK()" class="commonBut" />
                            <input type="button" value="取消" onclick=" CloseMask('popTable1');" class="commonBut" />
                        </td>
                    </tr>
                </table>
            </div>
            <!-- 转班弹出界面 结束 -->
            <!-- 导入开始 -->
            <div id="ImportForm" class="layoutWarp" style="display: none; width: 350px; overflow: inherit;">
                <div class="title">
                    <span id="ImportFormTitle"></span><a title="关闭" onclick="CloseForm()">关闭</a>
                </div>
                <table border="0" class="layoutTable" style="width: 340px;">
                    <form id="form2" target="t" enctype="multipart/form-data" method="post" onsubmit="GetActionString()">
                        <tr id="row3">
                            <td height="60" align="center" colspan="3">
                                <table border="0" style="width: 100%">
                                    <tr>
                                        <td style="text-align:left;">
                                            如果您要增加本班的学生，请点击：
                                            <a href="javascript:DownLoadExcel()" title="下载导入模板">下载导入模板</a><br />
                                            如果您要更新本班的学生名单，请使用更新导入。
                                        </td>
                                    </tr>
                                    <tr>
                                        <td id="upload" align="left">

                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="left">
                                            <input type="checkbox" id="chkOverWrite"/> 覆盖学号相同的学生信息
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <input type="submit" value="确定" class="commonBut" />&nbsp;&nbsp;
                                            <input id="Submit3" type="button" value="取消" class="commonBut" onclick="CloseForm()" />
                                            <iframe name="t" style="display: none"></iframe>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </form>
                </table>
            </div>
            <div id="Div_move" class="layoutWarp" style="display: none; width: 400px; overflow: inherit;">
                <div class="title">
                    <span id="Span_move"></span><a title="关闭" onclick="return CloseMask('Div_move');">关闭</a>
                </div>
                <table style="height:100px">
                    <tr>
                        <td><input id="status_zaix" type="radio" name="radio1" />在校</td>
                        <td><input id="status_zx" type="radio" name="radio1" />转学</td>
                        <td><input id="status_xx" type="radio" name="radio1" />休学</td>
                       
                    </tr>
                    <tr>
                        <td colspan="4"><input type="button" name="btn_move" class="commonBut" onclick="movestudent()" value="确定" /></td>
                    </tr>
                </table>
            </div>
            
            <div id="upInputPop" class="layoutWarp" style="display: none; width:380px;height:330px;">
                 <div class="title" >
	                <span id="upInputPopTitle"></span>
                    <a title="关闭" onclick="return ClosePopForm('upInputPop')">关闭</a>
                  </div>
                <iframe src="" name="ifram" id="uploadf" style="height: 80%;width: 95%;overflow-y:auto;overflow-x:none;" frameborder="0"   ></iframe>
            </div>
            <div id="upInputPop1" class="layoutWarp" style="display: none; width:380px;height:330px;">
                 <div class="title" >
                    <span id="upInputPopTitle1"></span>
                    <a title="关闭" onclick="return ClosePopForm('upInputPop1')">关闭</a>
                  </div>
                <div id="msginfo" style="text-align:left"></div>
            </div>
        </div>
    </div>
</body>
</html>
